import React,{Component}from 'react';
import {Button,Color,MessageBox}from 'element-react';

export default class TableStatus extends Component{
	constructor(props){
		super(props);
	
 }
 onClick(){
	if(this.props.status==1){
		MessageBox.alert(this.props.error,'错误提示');
	}
 }
 render(){
	 let btn_type='#13ce66',val='正常';
	 if(this.props.status==1){
		btn_type='#f7ba2a',val='错误';
	 }
	return (
			<Button type='text' style={{color:btn_type}} onClick={this.onClick.bind(this)} size='small'>{val}</Button>
		)
 
 }
}
